/*******************************************************************************
 * Copyright (c) 2012 Alexandr Tsvetkov.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * Contributors:
 *     Alexandr Tsvetkov - initial API and implementation
 *
 * Project:
 *     TAO Library
 *
 * File name:
 *     Rout.java
 *
 * License agreement:
 *
 * 1. This code is published AS IS. Author is not responsible for any damage that can be
 *    caused by any application that uses this code.
 * 2. Author does not give a garantee, that this code is error free.
 * 3. This code can be used in NON-COMMERCIAL applications AS IS without any special
 *    permission from author.
 * 4. This code can be modified without any special permission from author IF AND ONLY IF
 *    this license agreement will remain unchanged.
 * 5. SPECIAL PERMISSION for this code usage in COMMERCIAL application SHOULD be obtained
 *    from author.
 ******************************************************************************/
package ua.at.tsvetkov.ui;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;

/**
 * Creates the simple Ok Dialogs with one simple dismiss button.
 *
 * @author A.Tsvetkov 2011, http://tsvetkov.at.ua, al@ukr.net
 */
public class OkDialog {

	private static CharSequence	ok	= "Ok";

	/**
	 * @param title
	 * @param msg
	 */
	public static void show(Context context, int title, int msg) {
		Builder alert = new AlertDialog.Builder(context);
		alert.setPositiveButton(getOk(), null);
		alert.setTitle(title);
		alert.setMessage(msg);
		alert.create().show();
	}

	/**
	 * @param title
	 * @param msg
	 */
	public static void show(Context context, int title, CharSequence msg) {
		Builder alert = new AlertDialog.Builder(context);
		alert.setPositiveButton(getOk(), null);
		alert.setTitle(title);
		alert.setMessage(msg);
		alert.create().show();
	}

	/**
	 * @param title
	 * @param msg
	 */
	public static void show(Context context, CharSequence title, int msg) {
		Builder alert = new AlertDialog.Builder(context);
		alert.setPositiveButton(getOk(), null);
		alert.setTitle(title);
		alert.setMessage(msg);
		alert.create().show();
	}

	/**
	 * @param title
	 * @param msg
	 */
	public static void show(Context context, CharSequence title, CharSequence msg) {
		Builder alert = new AlertDialog.Builder(context);
		alert.setPositiveButton(getOk(), null);
		alert.setTitle(title);
		alert.setMessage(msg);
		alert.create().show();
	}

	public static CharSequence getOk() {
		return ok;
	}

	public static void setOk(String stOk) {
		ok = stOk;
	}

}
